package copyengine.ui.tooltips
{
	import copyengine.ui.tooltips.animation.ICETooltipsAnimation;

	import flash.display.DisplayObjectContainer;
	import flash.display.MovieClip;

	public class CEToolTipsBasic implements ICEToolTips
	{
		protected var tipsMc:MovieClip;

		private var animation:ICETooltipsAnimation;

		private var layoutHelper:CEToolTipsLayoutHelper;

		public function CEToolTipsBasic()
		{
		}

		public function initialize():void
		{
		}
		
		public final function setTipsMc(_tipsMc:MovieClip):void
		{
			tipsMc = _tipsMc;
		}

		public final function setAnimation(_animation:ICETooltipsAnimation):void
		{
			animation = _animation;
			animation.setTarget(tipsMc);
		}

		public final function setToolTipsLayoutHelper(_layoutHelper:CEToolTipsLayoutHelper):void
		{
			layoutHelper = _layoutHelper;
		}

		public final function mouseOnMove(_stagePosX:int, _stagePosY:int):void
		{
			layoutHelper.layoutTipsMc(tipsMc, _stagePosX, _stagePosY);
		}

		public final function getContainer():DisplayObjectContainer
		{
			return tipsMc;
		}

		public function show(_source:ICETooltipsSource):void
		{
			doShow(_source);
			animation && animation.showTips();
		}

		public function hide():void
		{
			doHide();
			animation && animation.hideTips();
		}

		public final function dispose():void
		{
			animation && animation.dispose();
			doDispose();
		}

		protected function doShow(_source:ICETooltipsSource):void
		{
		}

		protected function doHide():void
		{
		}

		protected function doDispose():void
		{
		}

	}
}